/**************************提示：只允许修改开发区域，其他区域会被覆盖！********************************/
mod.definePage("extend/cp/bc/js/BizAccountBill_View001",function(waf){
    //@beginUseModule
    var bizCollBillBase = mod.useSync("cp/bc/js/bizCollBillBase");
    var bizCollBillView = mod.useSync("cp/bc/js/bizCollBillView");
    var BizAccountBill_View = mod.useSync("cp/bc/js/BizAccountBill_View");
    //@endUseModule
    var _public = {},_private = {},me=_self;
    //@beginPublic
    waf.extend(_public,{
        //页面事件描述:分录控件隐藏/显示
        entriesControlChange:function(e){
             return _private.entriesControlChange(e);
        }
    });
    _self.subscribeEvent("fieldOnLoadEvent",_public.entriesControlChange,"after");
    //@endPublic
    //@beginTemplateFunctions

    //@endTemplateFunctions

    /**************************开发区域开始**********************************************/
    //@beginPrivate
    waf.extend(_private,{
    	entriesControlChange:function(e){
          var editGridDom = waf("#entries");
          editGridDom.wafGrid("hideColumn", ["purposeColumn","currencyType","exchangeRate","billingDate","amountOriWithoutTax","amountWithoutTax","taxRate","tax","amountApprovedOriWithoutTax","amountApprovedWithoutTax","taxApproved","company"]);
          
          var getDataIDs = editGridDom.wafGrid("getDataIDs");
          for(var i=0;i<getDataIDs.length;i++){
            var id=getDataIDs[i];
            
             var project = editGridDom.wafGrid("getCell", id, "project");
            if(project!=null&&project!=""&&project.name.l2=="会议费"){
              editGridDom.wafGrid("showColumn", ["meetingCost", "personNumber","dayNumber","quarterage","boardWages","otherExpenses"]);
              editGridDom.lockColumn("amountOri");
            }
            
            var meetingCost = editGridDom.wafGrid("getCell", id, "meetingCost");
            var option=_self.getOptionFromArguments(arguments);
            if(meetingCost!=null&&meetingCost!=""){
              option.action="MeetingCostAction";
              option.data={"id":meetingCost.id};
                option.async=false;
              option.success=function(data){
                  editGridDom.wafGrid("setCell", id, "meetingCost",data);
              }
          		waf.doPost(option);
            }
          }
        }
    
    });//@endPrivate
    /**************************开发区域结束**********************************************/
    return _public;
});
